package com.fyzk.activity.lottery.jc.football.newJz;


import com.fyzk.activity.lottery.jc.football.JCInfo;
import com.fyzk.activity.lottery.jc.football.JCZQ_BQC_ZhiFuActivity;
import com.fyzk.activity.lottery.jc.football.adapter.JCZQ_BQC_Adapter;
import com.fyzk.bean.JCZQResponseInfo;
import com.tyjc.lottery.R;
import com.fyzk.utils.LotteryIDUtils;

import java.util.List;


public class JCZQ_BQC_Fragment extends JCZQBaseFragment {

    private JCZQ_BQC_Adapter adapter;

    public void adapterChange(List<JCZQResponseInfo> infos) {
        changCiNum = 0;
        for (JCZQResponseInfo info_ : infos) {
            for (JCInfo info : info_.matchDatas) {
                if (info.getOnclikNum() > 0) {
                    changCiNum++;
                }
            }
        }
        btm_changCi.setText(changCiNum + "场");
        if (adapter != null) {
            adapter.setCount(changCiNum);
            notifyList();
        }
    }

    @Override
    protected Class getZhiFuActivity() {
        // TODO Auto-generated method stub
        return JCZQ_BQC_ZhiFuActivity.class;
    }

    @Override
    protected int getLotteryType() {
        // TODO Auto-generated method stub
        return LotteryIDUtils.JZBQC_LOTTERY_ID_INT;
    }

    @Override
    protected void initGameQueueView() {
        // TODO Auto-generated method stub
        super.initGameQueueView();
        adapter = new JCZQ_BQC_Adapter(getContext(), this, infos);
        center_list.setAdapter(adapter);
        for (int i = 0; i < adapter.getGroupCount(); i++) {
            center_list.expandGroup(i);
        }
        adapterChange(infos);
    }

    @Override
    protected int getTitleStringRes() {
        // TODO Auto-generated method stub
        return R.string.jcz_bqc;
    }


    @Override
    public void notifyList() {
        adapter.notifyDataSetChanged();
    }
}
